<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration
{
    /**
     * Run the migrations.
     */
    public function up(): void
    {
        Schema::create('entities', function (Blueprint $table) {
            $table->id();
            $table->string('name')->comment('厂商名称');
            $table->string('license')->comment('厂商营业执照编号');
            $table->string('legal_person')->comment('法人姓名');
            $table->string('contact')->comment('联系人');
            $table->string('contact_number')->comment('联系电话');
            $table->string('registered_capital')->comment('注册资金');
            $table->string('official_website')->nullable()->comment('官网链接');
            $table->date('expiration_date')->nullable()->comment('过期日期');
            $table->unsignedTinyInteger('type')->default(1)->comment('类型 1 生产商 2 agency 3 生产商+代理商');
            $table->text('intro')->comment('简介');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     */
    public function down(): void
    {
        Schema::dropIfExists('entities');
    }
};
